<!DOCTYPE html>
<html lang='en'>
<head>
  <link href="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
  <script src="http://netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
</head>
<body>

<div class="container">
	<p>
		Default:<br/>
		<input type='checkbox' name='checkbox1' />
	</p>

	<p>
		Event change:<br/>
		<input type='checkbox' name='checkbox2' checked />
	</p>
	<p>
		Different classes:<br/>
		<input type='checkbox' name='checkbox3' />
	</p>

	<p>
		Label Text:<br/>
		<input type='checkbox' name='checkbox4' />
	</p>

	<p>
		Same lables/text:<br/>
		<input type='checkbox' name='checkbox5' />
	</p>

	<p>
		Disabled:<br/>
		<input type='checkbox' name='checkbox10' disabled />
	</p>

	<p>
		Sizes (xs, sm, md, lg):<br/>
		<input type='checkbox' name='checkbox6' />
        <input type='checkbox' name='checkbox7' />
        <input type='checkbox' name='checkbox8' />
        <input type='checkbox' name='checkbox9' />
	</p>

</div>
<script src="bootstrap-switch.js" ></script>
<script>
// Remember set you events before call bootstrapSwitch or they will fire after bootstrapSwitch's events
$("[name='checkbox2']").change(function() {
	if(!confirm('Do you wanna cancel me!')) {
		this.checked = true;
	}
});

$("[name='checkbox1'],[name='checkbox2'], [name='checkbox10']").bootstrapSwitch();

$("[name='checkbox3']").bootstrapSwitch({
	on: 'Enabled',
	off: 'Disabled',
	onClass: 'success',
	offClass: 'warning'
});

$("[name='checkbox4']").bootstrapSwitch({
    onLabel: 'closed',
    offLabel: 'open'
});

$("[name='checkbox5']").bootstrapSwitch({
    same: true
});

$("[name='checkbox6']").bootstrapSwitch({
    size: 'xs'
});
$("[name='checkbox7']").bootstrapSwitch({
    size: 'sm'
});
$("[name='checkbox8']").bootstrapSwitch({
    size: 'md'//default
});
$("[name='checkbox9']").bootstrapSwitch({
    size: 'lg'
});


</script>


</body>
</html>

